#!/bin/sh
#Creado por Moi6 Lopez
#version 1.0

#Definiendo variables de entorno
pg_usr='postgres'
pgpassword='c4ti'
pg_host='localhost'
pg_port='5432'
pg_bin='/usr/bin'

dir_dest="/home/sis4/oerp3/miscelaneos/backup_bd"
pg_db='sisc4'
strftime=$(date +%Y-%m-%d_%H%M%S)
file_dest=$dir_dest"/"$pg_db"_"$strftime".backup"
ftp_dest=/home/sis4/myftp

echo $pg_bin/pg_dump -i -h $pg_host -p $pg_port -U $pg_usr -F c -b -v -f $file_dest $pg_db
$pg_bin/pg_dump -i -h $pg_host -p $pg_port -U $pg_usr -F c -b -v -f $file_dest $pg_db
cp $file_dest $ftp_dest
pause
